import { h } from 'preact'
import render from 'preact-render-to-string'
// import { createMemoryHistory } from "history"

import renderToString from '../../app/renderToString'

export default () => async (ctx, next) => {
    ctx.state.ssr = await renderToString({ url: ctx.path, store: ctx.state.store })
    // ctx.state.ssr = await render(<App url={ctx.path} store={ctx.state.store} />)
    // await console.info(ctx.state.content)
    await next()
}

